import java.util.Scanner;

public class Ex5_4{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		System.out.print("Enter an integer: ");
		int num = input.nextInt();
		System.out.printf("%d\n", reverse(num));
	}

	public static int reverse(int number){
		int sum = 0;
		while (number != 0){
			int d = number % 10;
			sum = sum * 10 + d;
			number /= 10;
		}
		return sum;
	}
}
